import os

from celery import Celery, platforms
from django.conf import settings

os.environ.setdefault('DJANGO_SETTINGS_MODULE', "fuadmin.settings")

# app = Celery(f"application")
app = Celery(f"system")

app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)

# app.autodiscover_tasks()
platforms.C_FORCE_ROOT = True

# app.conf.beat_schedule = {
#     # 'test_stock': {
#     #     'task': 'stock.tasks.test_stock',
#     #     'schedule': 2.0,
#     # },
#     # 'get_data': {
#     #     'task': 'system.tasks.test_task',
#     #     'schedule': 5.0,
#     # },
# }
